<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	  xmlns:th="http://www.thymeleaf.org">
	<style>
		:root{
			--windowW:0px;
			--widowH:0px;
		}
		.father{
			width:var(--windowW)-100px;
			height:var(--windowH)-100px;
			position:relative;
			display:flex;
			justify-content: center;
			align-items: center;
			
		}
		.myForms{
		    width: 800px;
		    height: 600px;
		    position: absolute;
		    top: 200px;
			display: flex;
			justify-content: center;
			align-items: center;	
		}
		.myForm{
			width: 500px;
			height: 500px;

		}
		.box{
			width: 400px;
			height: 45px;
			margin-left: 60px;
			margin-top: 10px;
		}
		.txt{
			font-size: 28px;
		}
		.B{
		    width: 300px;
		    height: 40px;
		    border-radius: 10px 10px 10px 10px;
		}
		.tijiao{
			width: 200px;
			height: 60px;
			position: absolute;
			top:450px;
			left:350px;
			background-color: white;
			border-radius: 10px 10px 10px 10px;
			font-size: 25px;
		}
	</style>
	<script type="text/javascript">
		var w=window.screen.availWidth;
		var h=window.screen.availHeight;
		
		document.documentElement.style.setProperty('--windowW',w+"px");
		document.documentElement.style.setProperty('--windowH',h+"px");
		function tijiao(){
			var id=document.getElementById("myId").value;
			var passwrod=document.getElementById("myPassword").value;
			var name=document.getElementById("myName").value;
			var college=document.getElementById("myCollege").value;
			var major=document.getElementById("myMajor").value;
			var age=document.getElementById("myAge").value;
			
			if(id==""){alert("学号不能为空")}
			else{
				if(passwrod==""){alert("密码不能为空")}
				else{
					if(name==""){alert("姓名不能为空")}
					else{
						if(college==""){alert("学院不能为空")}
						else{
							if(major==""){alert("专业不能为空")}
							else{
								if(age==""){alert("年级不能为空")}
								else{
									document.getElementById("myForm").submit();
									alert("注册成功");
									var told =confirm("单击“确定”前往登录"); 
									if (told) { 
									    window.location.href="http://localhost:8080/home/Home";
									};
								}
							}
						}
					}
				}
			}
		}
	</script>
	<body>
		<div class="father">
			<div class="myForms">
				<form class="myForm" id="myForm">
				  <div class="box">				  
					<span class="txt">学号：</span>
					<input type="text" class="B" id="myId" name="myId" value=""></input><br>
				  </div>
				  <div class="box">
					<span class="txt">密码：</span>
					<input type="password" id="myPassword"  name="myPassword" class="B" value=""><br>				  
				  </div>
				  <div class="box">
					<span class="txt">姓名：</span>
					<input type="text" id="myName"  name="myName" class="B" value=""><br>				  
				  </div>
				  <div class="box">
					<span class="txt">学院：</span>
					<input type="text" id="myCollege"  name="myCollege" class="B" value=""><br>				  
				  </div>
				  <div class="box">				  
					<span class="txt">专业：</span>
					<input type="text" id="myMajor"  name="myMajor" class="B" value=""><br>
				  </div>
				  <div class="box">				  
					<span class="txt">年级：</span>
					<input type="text" id="myAge"  name="myAge" class="B" value=""><br>
				  </div>
					<button class="tijiao" onclick="tijiao()">注册</button>
				</form>
			</div>
	    </div>
	</body>
</html>